import request from '@/utils/request'

// 创建设备/工装点巡检/保养生成任务
export function createMaintenancePlanGenerateTask(data) {
  return request({
    url: '/devices/maintenance-plan-generate-task/create',
    method: 'post',
    data: data
  })
}

// 更新设备/工装点巡检/保养生成任务
export function updateMaintenancePlanGenerateTask(data) {
  return request({
    url: '/devices/maintenance-plan-generate-task/update',
    method: 'put',
    data: data
  })
}

// 删除设备/工装点巡检/保养生成任务
export function deleteMaintenancePlanGenerateTask(id) {
  return request({
    url: '/devices/maintenance-plan-generate-task/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除设备/工装点巡检/保养生成任务 */
export function deleteMaintenancePlanGenerateTaskList(ids) {
  return request({
    url: `/devices/maintenance-plan-generate-task/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得设备/工装点巡检/保养生成任务
export function getMaintenancePlanGenerateTask(id) {
  return request({
    url: '/devices/maintenance-plan-generate-task/get?id=' + id,
    method: 'get'
  })
}

// 获得设备/工装点巡检/保养生成任务分页
export function getMaintenancePlanGenerateTaskPage(params) {
  return request({
    url: '/devices/maintenance-plan-generate-task/page',
    method: 'get',
    params
  })
}
// 导出设备/工装点巡检/保养生成任务 Excel
export function exportMaintenancePlanGenerateTaskExcel(params) {
  return request({
    url: '/devices/maintenance-plan-generate-task/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}